using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Collections.Generic;

namespace ERPBackend.Models
{
    public class Customer : BaseModel
    {
        [Required]
        [MaxLength(50)]
        public string CustomerCode { get; set; }

        [Required]
        [MaxLength(100)]
        public string CustomerName { get; set; }

        [MaxLength(50)]
        public string ShortName { get; set; }

        [Required]
        [MaxLength(50)]
        public string CustomerType { get; set; }

        [Required]
        [MaxLength(50)]
        public string Status { get; set; } // 启用、禁用

        [MaxLength(100)]
        public string ContactPerson { get; set; }

        [MaxLength(20)]
        public string Phone { get; set; }

        [MaxLength(50)]
        public string Email { get; set; }

        [MaxLength(200)]
        public string Address { get; set; }

        [MaxLength(50)]
        public string BankName { get; set; }

        [MaxLength(50)]
        public string BankAccount { get; set; }

        [MaxLength(50)]
        public string TaxId { get; set; }

        public decimal CreditLimit { get; set; }

        [MaxLength(500)]
        public string Remark { get; set; }

        // 导航属性
        public virtual ICollection<CustomerContact> CustomerContacts { get; set; } = new List<CustomerContact>();
    }
}